/*
 * Copyright 2009 Eat Local Food, LLC
 * Copyright (c) 2007 osCommerce (this file was written after
 * code review of osCommerce).
 *
 * This file is part of gwtCommerce.
 *
 * gwtCommerce is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * gwtCommerce is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with gwtCommerce.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.elf.gwt.store.client.components;

import com.elf.gwt.common.client.components.CommonMultipleResultsComponent;
import com.elf.gwt.store.client.StoreComponentController;
import com.google.gwt.core.client.GWT;
import com.google.gwt.json.client.JSONValue;


/**
 * 
 */

public class MultipleResultsComponent extends CommonMultipleResultsComponent
{
	/**
	 * Constructors
	 */
	public MultipleResultsComponent(StoreComponentController controller)
	{
		super(controller);
	}
	public void build(JSONValue jsonValue)
	{
		GWT.log("MultipleResultsComponent.build()");
		super.build(jsonValue);
		GWT.log("MultipleResultsComponent after super.build()");
		
		if (!controller.getDisplayPanel().isVisible()) controller.getDisplayPanel().setVisible(true);
		if (StoreComponentController.categoriesComponent.tree != null)
		{
			StoreComponentController.categoriesComponent.tree.setSelectedItem(null, false);
			StoreComponentController.categoriesComponent.collapseTree();
		}
		if (StoreComponentController.categoriesComponent != null) StoreComponentController.categoriesComponent.displaySelection();
		StoreComponentController.breadcrumbComponent.setToken(controller.getHistoryToken());
		StoreComponentController.breadcrumbComponent.build();

	}
}
